# Maintainer: Caleb Connolly <caleb@connolly.tech>
pkgname=qbootctl
pkgver=0.1.1
pkgrel=0
pkgdesc="Tool for interacting with Android A/B slots"
url="https://gitlab.com/sdm845-mainline/qbootctl"
# Only really useful on Qualcomm A/B Android devices
arch="all"
license="GPL-3.0-or-later"
subpackages="$pkgname-openrc"
makedepends="
	linux-headers
	meson
	zlib-dev
"
source="$pkgname-$pkgver.tar.gz::https://gitlab.com/sdm845-mainline/qbootctl/-/archive/$pkgver/qbootctl-$pkgver.tar.gz
	qbootctl-openrc.initd
"
options="!check" # no testsuite

build() {
	abuild-meson . output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output

	install -Dm755 "$srcdir/$pkgname-openrc.initd" "$pkgdir/etc/init.d/$pkgname"
}

sha512sums="
01ef51f10f1b6fe93bfc2e0ba979467c7d3cf3276450d057ced359ac9a2bc5f62a07e043acc27b0a0330d6677e261f974ac80a1301a093e632efcd99c65e76e1  qbootctl-0.1.1.tar.gz
da586749da1dd63e19f2bbc361b8c6689a713f4ea9d46d5f299c574ceda14aedad6c6f0fb5849c88cc99904a38a7318456a21417d212c147dd9d367752676a1e  qbootctl-openrc.initd
"
